Intersection in XY of two DSegment3d's
The following transaction script will find the point of intersection between two inputted lines.
transaction 1 modelChange 'Add point05' { node User.Objects.point05 Bentley.GC.NodeTypes.Point { Function = function (CoordinateSystem cs, Line lineA, Line lineB) { double fractionA; double fractionB; DPoint3d ptAD3d; DPoint3d ptBD3d; DSegment3d segmentA = lineA.DSegment3d; DSegment3d segmentB = lineB.DSegment3d; DSegment3d.IntersectXY(segmentA, segmentB, out fractionA, out ptAD3d, out fractionB, out ptBD3d); Point pt = new Point(); pt.FromDPoint3d(cs, ptBD3d); return pt; }; FunctionArguments = {baseCS,line01,line02}; } } transaction 2 modelChange 'Add baseCS' { node User.Objects.baseCS Bentley.GC.NodeTypes.CoordinateSystem { Technique = 'AtModelOrigin'; GraphLocation = <auto> {40.0, 40.0}; } } transaction 3 modelChange 'Change baseCS' { node User.Objects.baseCS Bentley.GC.NodeTypes.CoordinateSystem { Technique = 'AtModelOrigin'; DGNModelName = '3D Metric Design'; } } transaction 4 modelChange 'Add point1' { node User.Objects.point1 Bentley.GC.NodeTypes.Point { Technique = 'ByCartesianCoordinates'; CoordinateSystem = baseCS; XTranslation = <free> 16.5627587014873; YTranslation = <free> 14.9852807737223; ZTranslation = <free> 0.0; GraphLocation = <auto> {314.0, 40.0}; } } transaction 5 modelChange 'Add line01, point2' { node User.Objects.point2 Bentley.GC.NodeTypes.Point { Technique = 'ByCartesianCoordinates'; CoordinateSystem = baseCS; XTranslation = <free> 16.0115651157508; YTranslation = <free> 5.36800464915879; ZTranslation = <free> 0.0; GraphLocation = <auto> {314.0, 235.87}; } node User.Objects.line01 Bentley.GC.NodeTypes.Line { Technique = 'ByPoints'; StartPoint = point1; EndPoint = point2; GraphLocation = <auto> {588.0, 40.0}; } } transaction 6 modelChange 'Add point3' { node User.Objects.point3 Bentley.GC.NodeTypes.Point { Technique = 'ByCartesianCoordinates'; CoordinateSystem = baseCS; XTranslation = <free> 14.1236161692132; YTranslation = <free> 14.7622917509393; ZTranslation = <free> 0.0; GraphLocation = <auto> {314.0, 431.74}; } } transaction 7 modelChange 'Add line02, point4' { node User.Objects.point4 Bentley.GC.NodeTypes.Point { Technique = 'ByCartesianCoordinates'; CoordinateSystem = baseCS; XTranslation = <free> 12.127021192625; YTranslation = <free> 5.41209649285802; ZTranslation = <free> 0.0; GraphLocation = <auto> {314.0, 627.61}; } node User.Objects.line02 Bentley.GC.NodeTypes.Line { Technique = 'ByPoints'; StartPoint = point3; EndPoint = point4; GraphLocation = <auto> {588.0, 209.017}; } } transaction 8 modelChange 'Change line02' { node User.Objects.line02 Bentley.GC.NodeTypes.Line { GraphLocation = {583.68, 190.297, 0.0, 129.017}; } } transaction 9 modelChange 'Change line01' { node User.Objects.line01 Bentley.GC.NodeTypes.Line { GraphLocation = {595.2, 15.52, 0.0, 129.017}; } } transaction 10 modelChange 'Change point05' { node User.Objects.point05 Bentley.GC.NodeTypes.Point { GraphLocation = {945.76, 64.48, 174.0, 0.0}; } } transaction 11 modelChange 'Change line01' { node User.Objects.line01 Bentley.GC.NodeTypes.Line { GraphLocation = {566.4, 45.76, 0.0, 129.017}; } } transaction 12 modelChange 'Change point05' { node User.Objects.point05 Bentley.GC.NodeTypes.Point { Technique = 'ByFunction'; lineA = line01; } } transaction 13 modelChange 'Change point05' { node User.Objects.point05 Bentley.GC.NodeTypes.Point { Technique = 'ByFunction'; lineB = line02; } } transaction 14 modelChange 'Change point05' { node User.Objects.point05 Bentley.GC.NodeTypes.Point { Technique = 'ByFunction'; cs = baseCS; } }